<template>
	<view class="p30">
		<template v-if="list">
			<view v-for="(info,index) in list" :key="index"
			:class="info.status==2?'opacity':''"
			 style="border-radius: 10rpx;" class="box mt50 p30 u-flex bg-white ">
				<view class="u-flex u-row-between header">
					<text class="font-w600 title">{{info.meeting_name}}</text>
					<view class="">
						<u-tag :text="info.status_text" :type="info.status==1?'success':'info'" mode="dark" />
						<u-tag v-if="info.status==1" style="margin-left: 10rpx;" :text="info.sign_count+'人已签到'"  mode="dark" />	
					</view>
				</view>
				<view class="foot mt10">
					<view class="times">
						<text>开始时间：{{$u.timeFormat(info.start_time, 'yyyy-mm-dd hh:MM')}}</text>
						<text>结束时间：{{$u.timeFormat(info.end_time, 'yyyy-mm-dd hh:MM')}}</text>
					</view>
					<view class="">
						<u-button v-if="info.status" @click="record(info.id)" size="mini">佣金记录</u-button>
						<u-button style="margin-left: 10rpx;" v-if="info.status" @click="go(info.id)" size="mini">签到详情</u-button>
					</view>
				</view>
			</view>
		</template>
		<template v-else>
			<u-empty style="margin-top: 100rpx;" text="无数据" mode="list"></u-empty>
		</template>
		
	</view>
</template>

<script>
	export default {
		data() {
			return {
				list:{}
			}
		},
		onLoad(e) {
			this.getList()
		},
		methods: {
			record(id){
				uni.navigateTo({
					url:"/pages/user/meeting/record?id="+id,
				})
			},
			go(id){
				uni.navigateTo({
					url:"/pages/user/meeting/sign-log?id="+id,
				})
			},
			getList(){
				this.$u.get('member/api.users/meetingList').then(res => {
					
					this.list =res.data
					if(!res.data){
						uni.showToast({
							icon:'error',
							title:"无权访问"
						})
						setTimeout(()=>{
							uni.navigateBack()
						},2000)
					}
				})
			},
		}
	}
</script>

<style lang="scss">
	.bg-info{
		background-color: $u-type-warning-light;
	}
	.opacity{
		opacity: 0.5;
	}
	.sign{
		
		width: 280rpx;
		height: 280rpx;
		border-radius: 100%;
		
		display: flex;
		flex-direction: column;
		align-items: center;
		justify-content: center;
		text{
			font-size: 60rpx;
			font-weight: bold;
			color:#fff;
		}
	}
	.box{
		width: 100%;
		flex-direction: column;
		display: flex;
		justify-content: space-between;
		align-items: center;
		.title{
			font-size: 34rpx;
		}
		.header{
			display: flex;
			width: 100%;
			align-items: center;
		}
		.foot{
			display: flex;
			width: 100%;
			color: $u-tips-color;
			justify-content: space-between;
			align-items: center;
			.times{
				flex-direction: column;
				display: flex;
				font-size: 24rpx;
			}
		}
	}
</style>
